import Vue from "vue"
import Vuex from "vuex"
import modules from "./modules"
import getters from "./getters"
import Persistedstate from './persistedstate'

Vue.use(Vuex)
const debug = process.env.NODE_ENV !== "production"

export default new Vuex.Store({
	// 将vuex中数据同步到localstoage中。  插件会监听mutations方法，不会监听actions方法；
	plugins: [
		Persistedstate({
			key: '_kss_data_',
			paths: ['app'],
		}),
	],
	modules,
	getters,
	strict: debug
});